import { account } from "../utils/conf";
import {createRequest} from "./request"
const config=require("../utils/conf");
 var req=createRequest({
  baseUrl:config.url,
  header:config,
  params:{
    libcode:config.libcode,
    account:config.account
  },
  begin(options){
     // console.log("我开始请求"+options.url);
  },
  end(context){
    //console.log("我结束了请求"+context.success);
  },
  result(resp){
     return resp;
  }
});

export function setHeader(key,value){
  req._this.header[key]=value;
}
export function setParam(key,value){
  req._this.params[key]=value;
}
export default req.request;